All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.naming.directory.DSContext

public interface DSContext
extends Context
DSContext is the directory service interface. It contains methods for examining and updating attributes associated with objects, as well as methods for searching the directory. Each name passed as an argument to a DSContext object is relative to that context. The empty name is used to name the context itself.


Variable Index

 o ADD_ATTRIBUTE
Adds attribute with specified values.
 o DELETE_ATTRIBUTE
Deletes the specified attribute values from the attribute.
 o REPLACE_ATTRIBUTE
Adds attribute with specified values.

Method Index

 o bind(Name, Object, AttributeSet)
Binds 'name' to the object 'obj' and associate the attributes 'attrs' with the named object.
 o bind(String, Object, AttributeSet)
Binds 'name' to the object 'obj' and associate the attributes 'attrs' with the named object.
 o createSubcontext(Name, AttributeSet)
Creates a new subcontext with the given name, binds it in the target context (that named by all but terminal component of the name), and associates the attributes 'attrs' with the newly created object.
 o createSubcontext(String, AttributeSet)
Creates a new subcontext with the given name, binds it in the target context (that named by all but terminal atomic component of the name), and associates the attributes 'attrs' with the newly created object.
 o getAttributes(Name)
Retrieves all of the attributes associated with the named object.
 o getAttributes(Name, String[])
Retrieves the attributes listed in attrIds associated with the named object.
 o getAttributes(String)
Retrieves all of the attributes associated with the named object.
 o getAttributes(String, String[])
Retrieves the attributes listed in attrIds associated with the named object.
 o getSchema(Name)
Retrieves the schema associated with the named DSContext.
 o getSchema(String)
Retrieves the schema associated with the named DSContext.
 o getSchemaClassDefinition(Name)
Retrieves the schema class definition associated with the named DSContext.
 o getSchemaClassDefinition(String)
Retrieves the schema class definition associated with the named DSContext.
 o modifyAttributes(Name, int, AttributeSet)
Modifies according to mod_op and attrs the attributes associated with the named object.
 o modifyAttributes(Name, ModificationEnumeration)
Modifies according to mods the attributes associated with the named object.
 o modifyAttributes(String, int, AttributeSet)
Modifies according to mod_op and attrs the attributes associated with the named object.
 o modifyAttributes(String, ModificationEnumeration)
Modifies according to mods the attributes associated with the named object.
 o rebind(Name, Object, AttributeSet)
Binds 'name' to the object 'obj' and associates the attributes 'attrs' with the named object.
 o rebind(String, Object, AttributeSet)
Binds 'name' to the object 'obj' and associates the attributes 'attrs' with the named object.
 o search(Name, AttributeSet)
Searches in a single context for objects that contain a specified set of attributes.
 o search(Name, AttributeSet, String[])
Searches in a single context for objects that contain a specified set of attributes.
 o search(Name, String, Object[], SearchConstraints)
Searches in the named context for entries that satisfy the given search filter.
 o search(Name, String, SearchConstraints)
Searches in the named context for entries that satisfy the given search filter.
 o search(String, AttributeSet)
Searches in a single context for objects that contain a specified set of attributes.
 o search(String, AttributeSet, String[])
Searches in a single context for objects that contain a specified set of attributes.
 o search(String, String, Object[], SearchConstraints)
Searches in the named context for entries that satisfy the given search filter.
 o search(String, String, SearchConstraints)
Searches in the named context for entries that satisfy the given search filter.

Variables

 o ADD_ATTRIBUTE
 public static final int ADD_ATTRIBUTE
Adds attribute with specified values. If attribute does not exist, create the attribute. The resulting attribute has a union of the specified value set and the prior value set. Adding an attribute with no value will throw InvalidAttributeValueException if the attribute must have at least one value. For a single-valued attribute, if attribute already exists, throws AttributeInUseException. If attempting to add more than one value to a single-valued attribute, throws InvalidAttributeValueException.

 o REPLACE_ATTRIBUTE
 public static final int REPLACE_ATTRIBUTE
Adds attribute with specified values. If attribute already exists, replace all existing values with new specified values. If the attribute does not exist, create it. If no value is specified, delete all the values of the attribute. Removal of the last value will remove the attribute if the attribute is required to have at least one value. If attempting to add more than one value to a single-valued attribute, throws InvalidAttributeValueException.

 o DELETE_ATTRIBUTE
 public static final int DELETE_ATTRIBUTE
Deletes the specified attribute values from the attribute. The resulting attribute has the set difference of its prior value set and the specified value set. If no values are specified, delete the entire attribute. If the attribute does not exist, or if some or all members of the specified value set does not exist, they are ignored silently and this operation still succeeds. Removal of the last value will remove the attribute if the attribute is required to have at least one value.

Methods

 o getAttributes
 public abstract AttributeSet getAttributes(String name) throws NamingException
Retrieves all of the attributes associated with the named object.

Parameters:
name - The name of the object from which to retrieve attributes.
Returns:
The attributes associated with 'name'.
 o getAttributes
 public abstract AttributeSet getAttributes(Name name) throws NamingException
Retrieves all of the attributes associated with the named object.

Parameters:
name - The name of the object from which to retrieve attributes.
Returns:
The attributes associated with 'name'.
 o getAttributes
 public abstract AttributeSet getAttributes(String name,
                                            String attrIds[]) throws NamingException
Retrieves the attributes listed in attrIds associated with the named object.

Parameters:
name - The name of the object from which to retrieve attributes.
attrIds - The identifiers of the attributes to retrieve. null indicates that all attributes should be retrieved.
Returns:
The attributes identified by attrIds (or a subset thereof if some attributes cannot be retrieved).
 o getAttributes
 public abstract AttributeSet getAttributes(Name name,
                                            String attrIds[]) throws NamingException
Retrieves the attributes listed in attrIds associated with the named object.

Parameters:
name - The name of the object from which to retrieve attributes.
attrIds - The identifiers of the attributes to retrieve. null indicates that all attributes should be retrieved.
Returns:
The attributes identified by attrIds (or a subset thereof if some attributes cannot be retrieved).
 o modifyAttributes
 public abstract void modifyAttributes(String name,
                                       int mod_op,
                                       AttributeSet attrs) throws NamingException
Modifies according to mod_op and attrs the attributes associated with the named object. The order of the modifications within attrs is not specified. Where possible, the modifications are performed atomically. If the operation fails to complete, AttributeModificationException is thrown containing details of the failure.

Parameters:
name - The name of the object whose attributes will be updated.
mod_op - The modification operation. It is one of ADD_ATTRIBUTE, REPLACE_ATTRIBUTE, DELETE_ATTRIBUTE.
attrs - The attributes to be used for the modification.
 o modifyAttributes
 public abstract void modifyAttributes(Name name,
                                       int mod_op,
                                       AttributeSet attrs) throws NamingException
Modifies according to mod_op and attrs the attributes associated with the named object. The order of the modifications within attrs is not specified. Where possible, the modifications are performed atomically. If the operation fails to complete, AttributeModificationException is thrown containing details of the failure.

Parameters:
name - The name of the object whose attributes will be updated.
mod_op - The modification operation. It is one of ADD_ATTRIBUTE, REPLACE_ATTRIBUTE, DELETE_ATTRIBUTE.
attrs - The attributes to be used for the modification.
 o modifyAttributes
 public abstract void modifyAttributes(String name,
                                       ModificationEnumeration mods) throws NamingException
Modifies according to mods the attributes associated with the named object. The modifications are to be performed in the order specified. Each modification specifies a modification operation code and an attribute on which to operation. Where possible, the list of modifications are to be performed atomically. If the operation fails to complete, AttributeModificationException is thrown containing details of the failure.

Parameters:
name - The name of the object whose attributes will be updated.
mods - An ordered sequence of modifications that are to be performed on the attributes of the named object.
See Also:
ModificationEnumeration
 o modifyAttributes
 public abstract void modifyAttributes(Name name,
                                       ModificationEnumeration mods) throws NamingException
Modifies according to mods the attributes associated with the named object. The modifications are to be performed in the order specified. Each modification specifies a modification operation code and an attribute on which to operation. Where possible, the list of modifications are to be performed atomically. If the operation fails to complete, AttributeModificationException is thrown containing details of the failure.

Parameters:
name - The name of the object whose attributes will be updated.
mods - An ordered sequence of modifications that are to be performed on the attributes of the named object.
See Also:
ModificationEnumeration
 o bind
 public abstract void bind(String name,
                           Object obj,
                           AttributeSet attrs) throws NamingException
Binds 'name' to the object 'obj' and associate the attributes 'attrs' with the named object. If 'attrs' is null, the resulting binding will have the attributes associated with 'obj' if 'obj' is a DSContext. If 'obj' is not a DSContext and 'attrs' is null, the resulting binding will have no attributes. If 'attrs' is non-null, the resulting binding will have 'attrs' as its attributes and any attributes associated with 'obj' are ignored.

Parameters:
name - The name to bind. It cannot be empty.
obj - The object to bind.
attrs - The attributes to associate with the bound object.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If the attributes specified by 'attrs', or 'obj' if 'attrs' is null, are not sufficient to create the binding.
See Also:
java.naming.Context.bind, rebind
 o bind
 public abstract void bind(Name name,
                           Object obj,
                           AttributeSet attrs) throws NamingException
Binds 'name' to the object 'obj' and associate the attributes 'attrs' with the named object. If 'attrs' is null, the resulting binding will have the attributes associated with 'obj' if 'obj' is a DSContext. If 'obj' is not a DSContext and 'attrs' is null, the resulting binding will have no attributes. If 'attrs' is non-null, the resulting binding will have 'attrs' as its attributes and any attributes associated with 'obj' are ignored.

Parameters:
name - The name to bind. It cannot be empty.
obj - The object to bind.
attrs - The attributes to associate with the bound object.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If the attributes specified by 'attrs', or 'obj' if 'attrs' is null, are not sufficient to create the binding.
See Also:
java.naming.Context.bind, rebind
 o rebind
 public abstract void rebind(String name,
                             Object obj,
                             AttributeSet attrs) throws NamingException
Binds 'name' to the object 'obj' and associates the attributes 'attrs' with the named object. If 'name' is already bound, 'obj' overwrites the existing binding. If 'attrs' is null and 'obj' is a DSContext, the attributes from 'obj' are used. If 'attrs' is null and 'obj' is not a DSContext, any existing attributes associated with the already bound object remain unchanged. If 'attrs' is non-null, any existing attributes associated with the already bound object are removed and 'attrs' is associated with the named object. If 'obj' is a DSContext and 'attrs' is non-null, obj's attributes are ignored.

Parameters:
name - The name to bind.
obj - The object to bind.
attrs - The attributes to associate with the bound object.
Throws: InvalidAttributeSetException
If attrs does not supply all mandatory attributes required to create the binding.
 o rebind
 public abstract void rebind(Name name,
                             Object obj,
                             AttributeSet attrs) throws NamingException
Binds 'name' to the object 'obj' and associates the attributes 'attrs' with the named object. If 'name' is already bound, 'obj' overwrites the existing binding. If 'attrs' is null and 'obj' is a DSContext, the attributes from 'obj' are used. If 'attrs' is null and 'obj' is not a DSContext, any existing attributes associated with the object already bound in the directory remain unchanged. If 'attrs' is non-null, any existing attributes associated with the object already bound in the directory are removed and 'attrs' is associated with the named object. If 'obj' is a DSContext and 'attrs' is non-null, obj's attributes are ignored.

Parameters:
name - The name to bind.
obj - The object to bind.
attrs - The attributes to associate with the bound object.
Throws: InvalidAttributeSetException
If attrs does not supply all mandatory attributes required to create the binding.
 o createSubcontext
 public abstract DSContext createSubcontext(String name,
                                            AttributeSet attrs) throws NamingException
Creates a new subcontext with the given name, binds it in the target context (that named by all but terminal atomic component of the name), and associates the attributes 'attrs' with the newly created object. All intermediate and target contexts must already exist.

Parameters:
name - The name to use when creating the new context. It cannot be empty.
attrs - The attributes to associate with the newly created context.
Returns:
The newly created context.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If 'attrs' does not contain all the mandatory attributes required for creation.
See Also:
java.naming.Context.createSubcontext
 o createSubcontext
 public abstract DSContext createSubcontext(Name name,
                                            AttributeSet attrs) throws NamingException
Creates a new subcontext with the given name, binds it in the target context (that named by all but terminal component of the name), and associates the attributes 'attrs' with the newly created object. All intermediate and target contexts must already exist.

Parameters:
name - The name to use when creating the new context. It cannot be empty.
attrs - The attributes to associate with the newly created context.
Returns:
The newly created context.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If 'attrs' does not contain all the mandatory attributes required for creation.
See Also:
java.naming.Context.createSubcontext
 o getSchema
 public abstract DSContext getSchema(String name) throws NamingException
Retrieves the schema associated with the named DSContext.

Parameters:
name - The name of the DSContext.
Returns:
The schema associated with the DSContext.
 o getSchema
 public abstract DSContext getSchema(Name name) throws NamingException
Retrieves the schema associated with the named DSContext.

Parameters:
name - The name of the DSContext.
Returns:
The schema associated with the DSContext.
 o getSchemaClassDefinition
 public abstract DSContext getSchemaClassDefinition(String name) throws NamingException
Retrieves the schema class definition associated with the named DSContext.

Parameters:
name - The name of the DSContext.
Returns:
The schema class definition associated with name.
 o getSchemaClassDefinition
 public abstract DSContext getSchemaClassDefinition(Name name) throws NamingException
Retrieves the schema class definition associated with the named DSContext.

Parameters:
name - The name of the DSContext.
Returns:
The schema class definition associated with name.
 o search
 public abstract SearchEnumeration search(String name,
                                          AttributeSet matchingAttributes) throws NamingException
Searches in a single context for objects that contain a specified set of attributes.

Parameters:
name - The name of the context to search.
matchingAttributes - The attributes to search for.
Returns:
An enumeration of the objects that have the attributes specified in matchingAttributes. Each item in the enumeration contains all of the attributes associated with that object.
 o search
 public abstract SearchEnumeration search(Name name,
                                          AttributeSet matchingAttributes) throws NamingException
Searches in a single context for objects that contain a specified set of attributes.

Parameters:
name - The name of the context to search.
matchingAttributes - The attributes to search for.
Returns:
An enumeration of the objects that have the attributes specified in matchingAttributes. Each item in the enumeration contains all of the attributes associated with that object.
 o search
 public abstract SearchEnumeration search(String name,
                                          AttributeSet matchingAttributes,
                                          String attributesToReturn[]) throws NamingException
Searches in a single context for objects that contain a specified set of attributes.

Parameters:
name - The name of the context to search.
matchingAttributes - The attributes to search for.
attributesToReturn - The attributes to return. null indicates that all attributes should be returned.
Returns:
An enumeration of the objects that has the attributes specified in matchingAttributes. Each item in the enumeration contains the attributes identified by attributesToReturn.
 o search
 public abstract SearchEnumeration search(Name name,
                                          AttributeSet matchingAttributes,
                                          String attributesToReturn[]) throws NamingException
Searches in a single context for objects that contain a specified set of attributes.

Parameters:
name - The name of the context to search.
matchingAttributes - The attributes to search for.
attributesToReturn - The attributes to return. null indicates that all attributes should be returned.
Returns:
An enumeration of the objects that has the attributes specified in matchingAttributes. Each item in the enumeration contains the attributes identified by attributesToReturn.
 o search
 public abstract SearchEnumeration search(String name,
                                          String filter,
                                          SearchConstraints cons) throws NamingException
Searches in the named context for entries that satisfy the given search filter. Performs the search as specified in the search constraints 'cons'.

Parameters:
name - The name of the context at which to start the search.
filter - The filter to use for the search. Uses the LDAP filter syntax specified in RFC 1960.
cons - The search constraints to be applied to the search.
Returns:
An enumeration of the objects that satisfy the filter.
 o search
 public abstract SearchEnumeration search(Name name,
                                          String filter,
                                          SearchConstraints cons) throws NamingException
Searches in the named context for entries that satisfy the given search filter. Performs the search as specified in the search constraints 'cons'.

Parameters:
name - The name of the context at which to start the search.
filter - The filter to use for the search. Uses the LDAP filter syntax specified in RFC 1960.
cons - The search constraints to be applied to the search.
Returns:
An enumeration of the objects that satisfy the filter.
 o search
 public abstract SearchEnumeration search(String name,
                                          String filterExpr,
                                          Object filterArgs[],
                                          SearchConstraints cons) throws NamingException
Searches in the named context for entries that satisfy the given search filter. Performs the search as specified in the search constraints 'cons'.

Parameters:
name - The name of the context at which to start the search.
filterExpr - The filter expression to use for the search. The expression may contain variables of the form {i} where 'i' is an integral number.
filterArgs - The arguments to substitute for the variables in filterExpr. filterArgs[i] will replace all occurrences of {i}.
cons - The search constraints to be applied to the search.
Returns:
An enumeration of the objects that satisfy the filter.
 o search
 public abstract SearchEnumeration search(Name name,
                                          String filterExpr,
                                          Object filterArgs[],
                                          SearchConstraints cons) throws NamingException
Searches in the named context for entries that satisfy the given search filter. Performs the search as specified in the search constraints 'cons'.

Parameters:
name - The name of the context at which to start the search.
filterExpr - The filter expression to use for the search. The expression may contain variables of the form {i} where 'i' is an integral number.
filterArgs - The arguments to substitute for the variables in filterExpr. filterArgs[i] will replace all occurrences of {i}.
cons - The search constraints to be applied to the search.
Returns:
An enumeration of the objects that satisfy the filter.

All Packages  Class Hierarchy  This Package  Previous  Next  Index